﻿<%@ Page Title="Mapa" Language="C#" MasterPageFile="~/MasterPage/Master.Master" AutoEventWireup="true"
    CodeBehind="wFrmMapa.aspx.cs" Inherits="Crosland.Automotriz.Web.CRM.wFrmMapa" %>

<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v13.1, Version=13.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>

<%@ Register Assembly="GMaps" Namespace="Subgurim.Controles" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
    <script language="javascript" type="text/javascript">

        function editarLocal(idLocal, idCliente) {
            window.location = "wFrmClienteLocalActualizar.aspx?IdLocal=" + idLocal + "&IdCliente=" + idCliente;
        }

        function AmpliarMapa() {
            //debugger;
            var w = screen.availWidth;
            var h = screen.availHeight - 35;
            var dep = cboDepartamento.GetValue();
            var pro = cboProvincia.GetValue();
            var dis = cboDistrito.GetValue();
            var sup = cboSupervisor.GetValue();

            var chkBox = document.getElementById("chkClasificacion");
            var options = chkBox.getElementsByTagName('input');

            var checks = '';
            for (var i = 0; i < options.length; i++) {
                checks = checks + '&p' + i + '=' + options[i].checked;
            }

            var direccion = './wFrmMapaPopup.aspx?dep=' + dep + '&pro=' + pro + '&dis=' + dis + '&sup=' + sup + checks;

            window.open(direccion, 'NewWindow', 'top=0,left=0, width=' + w + ',height=' + h + ',status=no, resizable=no,scrollbars=no');
        }

    </script>
    <style type="text/css">
        .iframe
        {
            display: block;
            width: 100%;
            height: 600px;
            border: 1px solid #C4C4C4;
        }
    </style>
    <div style="padding: 15px">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <div class="main-header" style="width: 100%;">
                    <div class="main-titulo" style="text-align: left">
                        Mapeo de Mercado</div>
                </div>
                <dx:ASPxRoundPanel ID="rpBusqueda" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                    CssPostfix="Office2010Blue" EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px"
                    GroupBoxCaptionOffsetY="-19px" HeaderText="Filtros de Búsqueda" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                    Width="100%">
                    <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
                    <ContentPaddings PaddingLeft="9px" PaddingTop="10px" PaddingRight="11px" PaddingBottom="10px">
                    </ContentPaddings>
                    <HeaderStyle>
                        <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
                        <Paddings PaddingLeft="9px" PaddingTop="3px" PaddingRight="11px" PaddingBottom="6px">
                        </Paddings>
                    </HeaderStyle>
                    <PanelCollection>
                        <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                            <table width="100%">
                                <tr>
                                    <td style="width: 92px">
                                        <asp:Label ID="Label1" runat="server" Text="Departamento:"></asp:Label>
                                    </td>
                                    <td width="205">
                                        <dx:ASPxComboBox ID="cboDepartamento" runat="server" AutoPostBack="True" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="25px" OnSelectedIndexChanged="cboDepartamento_SelectedIndexChanged"
                                            Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Width="200px"
                                            ClientInstanceName="cboDepartamento" ClientIDMode="Static" IncrementalFilteringMode="Contains">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ButtonStyle Width="13px">
                                            </ButtonStyle>
                                            <Paddings PaddingLeft="5px" />
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td style="width: 62px">
                                        <asp:Label ID="Label2" runat="server" Text="Provincia:"></asp:Label>
                                    </td>
                                    <td width="205">
                                        <dx:ASPxComboBox ID="cboProvincia" runat="server" AutoPostBack="True" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="25px" OnSelectedIndexChanged="cboProvincia_SelectedIndexChanged"
                                            Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" Width="200px"
                                            ClientIDMode="Static" ClientInstanceName="cboProvincia" IncrementalFilteringMode="Contains">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ButtonStyle Width="13px">
                                            </ButtonStyle>
                                            <Paddings PaddingLeft="5px" />
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td style="width: 51px">
                                        <asp:Label ID="Label3" runat="server" Text="Distrito:"></asp:Label>
                                    </td>
                                    <td width="205">
                                        <dx:ASPxComboBox ID="cboDistrito" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="25px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Width="200px" ClientIDMode="Static" ClientInstanceName="cboDistrito" 
                                            IncrementalFilteringMode="Contains" 
                                            OnSelectedIndexChanged="cboDistrito_SelectedIndexChanged">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ButtonStyle Width="13px">
                                            </ButtonStyle>
                                            <Paddings PaddingLeft="5px" />
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td rowspan="2" align="right">
                                        <dx:ASPxButton ID="btnBuscar" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="80px" OnClick="btnBuscar_Click" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Text="Buscar" Width="100px">
                                            <Image Url="~/Images/search.png">
                                            </Image>
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 92px">
                                        <asp:Label ID="Label4" runat="server" Text="Supervisor:"></asp:Label>
                                    </td>
                                    <td colspan="3" style="width: 410px" width="205">
                                        <dx:ASPxComboBox ID="cboSupervisor" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="25px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Width="475px" ClientIDMode="Static" ClientInstanceName="cboSupervisor" 
                                            IncrementalFilteringMode="Contains" 
                                            OnSelectedIndexChanged="cboSupervisor_SelectedIndexChanged">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ButtonStyle Width="13px">
                                            </ButtonStyle>
                                            <Paddings PaddingLeft="5px" />
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td style="width: 51px">
                                        <asp:Label ID="Label6" runat="server" Text="Modelo:" Visible="False"></asp:Label>
                                    </td>
                                    <td width="205">
                                        <dx:ASPxComboBox ID="cboModelo" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" Height="25px" Spacing="0" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Width="200px" Visible="False" 
                                            OnSelectedIndexChanged="cboModelo_SelectedIndexChanged">
                                            <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Editors/Loading.gif">
                                            </LoadingPanelImage>
                                            <LoadingPanelStyle ImageSpacing="5px">
                                            </LoadingPanelStyle>
                                            <ButtonStyle Width="13px">
                                            </ButtonStyle>
                                            <Paddings PaddingLeft="5px" />
                                        </dx:ASPxComboBox>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 92px">
                                        <asp:Label ID="Label5" runat="server" Text="Clasificación:"></asp:Label>
                                    </td>
                                    <td colspan="6" width="155">
                                        <asp:CheckBoxList ID="chkClasificacion" runat="server" Font-Size="10px" RepeatColumns="5"
                                            ClientIDMode="Static" 
                                            OnSelectedIndexChanged="chkClasificacion_SelectedIndexChanged">
                                        </asp:CheckBoxList>
                                    </td>
                                    <td width="155" align="right">
                                        <dx:ASPxButton ID="btnZoom" runat="server" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                            CssPostfix="Office2010Blue" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css"
                                            Text="Zoom" Width="100px" OnClick="btnZoom_Click">
                                            <ClientSideEvents Click="function(s, e) {
	                                                                    AmpliarMapa();
                                                                    }" />
                                            <Image Url="~/Images/search.png">
                                            </Image>
                                        </dx:ASPxButton>
                                    </td>
                                </tr>
                            </table>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxRoundPanel>
                <table cellpadding="0" cellspacing="0" style="width: 100%; height: 2px">
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <div class="contenedor-mapadet">
                    <div class="mapa-leyenda">
                        <img src="../Images/leyenda.png" alt="Leyenda de Locales" />
                    </div>
                    <%--<cc1:gmap ID="mapa3" runat="server" Width="100%" Height="450px" />--%>
                    <iframe src="wFrmGMap.aspx" class="iframe"></iframe>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
